<extend name="Public/base" />

<block name="body">
    <div id="indexMain" class="index-main">
        <br/><br/>
        <!-- 插件块 -->
        <div class="container-span">
            <dl class="show-num-mod">
                <dt><i class="count-icon doc-count-icon"></i></dt>
                <dd>
                    <strong style="color:red">{$useramount.amount}</strong>
                    <span>用户总余额</span>
                </dd>
            </dl>
            <dl class="show-num-mod">
                <dt><i class="count-icon doc-modal-icon"></i></dt>
                <dd>
                    <strong style="color:red">{$orderAmount}</strong>
                    <span>订单金额</span>
                </dd>
            </dl>
            <dl class="show-num-mod">
                <dt><i class="count-icon user-count-icon"></i></dt>
                <dd>
                    <strong style="color:red">{$userCount}</strong>
                    <span>用户数</span>
                </dd>
            </dl>
            <dl class="show-num-mod">
                <dt><i class="count-icon user-count-icon"></i></dt>
                <dd>
                    <strong style="color:red">{$count}</strong>
                    <span>新增用户数</span>
                </dd>
            </dl>
        </div>
    </div>

</block>

<block name="script">
    <script type="text/javascript" src="__JS__/Chart.min.js"></script>
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
    <link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
    <script type="text/javascript">
        //搜索功能
        $("#search").click(function () {
            var url = $(this).attr('url');

            var query = $('.search-form').find('input').serialize();
            var queryselect = $('.search-form').find('select').serialize();

            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            query = query.replace(/^&/g, '');
            queryselect = queryselect.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            queryselect = queryselect.replace(/^&/g, '');

            if (url.indexOf('?') > 0) {
                url += '&' + query;
                url += '&' + queryselect;
            } else {
                url += '?' + query;
                url += '?' + queryselect;
            }

            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function (e) {
            if (e.keyCode === 13) {
                $("#search").click();
                return false;
            }
        });
        //导航高亮
        highlight_subnav('{:U('Report/amount')}');
        
        $(function () {
            $('.time').datetimepicker({
                format: 'yyyy-mm-dd',
                language: "zh-CN",
                minView: 2,
                autoclose: true
            });
        });
        
        function export1(){
            var url = "{:U('Report/amountExport')}";
            $("#form1").attr("action", url).submit();
        }
        
        
        var data = {
	labels : [{$report_day}],
	datasets : [		
		{
			fillColor : "rgba(151,187,205,0.5)",
			strokeColor : "rgba(151,187,205,1)",
			pointColor : "rgba(151,187,205,1)",
			pointStrokeColor : "#fff",
			data : [{$finalAmountArray}]
		},
        {
            fillColor : "rgba(180,20,20,0.1)",
            strokeColor : "rgba(180,20,20,1)",
            pointColor : "rgba(180,20,20,1)",
            pointStrokeColor : "#fff",
            data : [{$totalrejectprice}]
        }
	]
        }
        var ctx = document.getElementById("myChart").getContext("2d");
        var myNewChart = new Chart(ctx).Line(data);
    </script>
</block>
